<template>
  <div class="newslist">
    <van-card
      v-for="item in newsList"
      :key="item.id"
      :title="item.title"
      :thumb="item.img_url"
      :thumb-link="'#/home/newsinfo/' + item.id"
    >
      <template #price>
        {{ item.add_time }}
      </template>
      <template #num>
        {{ '阅读' + item.click + '次' }}
      </template>
    </van-card>
  </div>
</template>
<script>
export default {
  data() {
    return {
      newsList: [],
    };
  },
  created() {
    this.GetNewsList();
  },
  methods: {
    async GetNewsList() {
      const res = await this.$http.getNewslist();
      this.newsList = res.data.message;
    },
  },
};
</script>
<style lang="scss" scoped>
.newslist {
  .van-card__price {
    color: red;
  }
  .van-card__content {
    min-height: 55px;
  }
  .van-card__thumb {
    height: 55px;
  }
  .van-card__title {
    font-size: 14px;
    font-weight: 600;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }
}
</style>
